inputs = raw_input()
PATest={}
for e in 'PATest':
    PATest[e]=0
for e in inputs:
    if e in 'PATest':
        PATest[e]+=1

outputs = []
while True:
    flag=True
    if PATest['P'] > 0:
        outputs.append('P')
        PATest['P']-=1
        flag=False
    if PATest['A'] > 0:
        outputs.append('A')
        PATest['A']-=1
        flag=False
    if PATest['T'] > 0:
        outputs.append('T')
        PATest['T']-=1
        flag=False
    if PATest['e'] > 0:
        outputs.append('e')
        PATest['e']-=1
        flag=False
    if PATest['s'] > 0:
        outputs.append('s')
        PATest['s']-=1
        flag=False
    if PATest['t'] > 0:
        outputs.append('t')
        PATest['t']-=1
        flag=False
    if flag:
        break

print ''.join(outputs)